<div class="g-col g-col-2">
  <div class="par parsys">
    <div class="textimage">
      <div class="mod mod-text-image skin-text-only clearfix">
        <div class="mod mod-media-lightbox">
          <div class="content rich">
            <?= $taxonomyDescription ?>
          </div>
        </div>
      </div>
    </div>
    <div class="caselist">
      <div class="mod mod-ajax-html-replacer" data-connectors="filtercases">
        <div class="mod mod-filter" data-connectors="filtercases"
             data-url="https://www.nobelbiocare.com/international/en/home/products-and-solutions/library/clinical-cases/_jcr_content/par/caselist_23ba.html">
          <form class="b">
            <div class="clearfix">
              <?php if (!empty($taxonomyBrand)) { ?>
                <div class="selectbox">
                  <select name="filterTag_0" class="js-select bid-<?= $url ?>">
                    <option value="">品牌</option>
                    <?php foreach ($taxonomyBrand as $k => $value) { ?>
                      <option
                        value="<?= $value['key'] ?>" <?= !empty(drupal_get_query_parameters()['brand']) && drupal_get_query_parameters()['brand'] == $value['key'] ? 'selected' : '' ?>><?= $value['value'] ?></option>
                    <?php } ?>
                  </select>
                </div>
              <?php } ?>
              <?php if (!empty($taxonomyDisease)) { ?>
                <div class="selectbox">
                  <select name="filterTag_1" class="js-select did-<?= $url ?>">
                    <option value="">病症</option>
                    <?php foreach ($taxonomyDisease as $k => $value) { ?>
                      <option
                        value="<?= $value['key'] ?>" <?= !empty(drupal_get_query_parameters()['disease']) && drupal_get_query_parameters()['disease'] == $value['key'] ? 'selected' : '' ?>><?= $value['value'] ?></option>
                    <?php } ?>
                  </select>
                </div>
              <?php } ?>
              <?php if (!empty($taxonomyIdea)) { ?>
                <div class="selectbox">
                  <select name="filterTag_2" class="js-select iid-<?= $url ?>">
                    <option value="">治疗理念</option>
                    <?php foreach ($taxonomyIdea as $k => $value) { ?>
                      <option
                        value="<?= $value['key'] ?>" <?= !empty(drupal_get_query_parameters()['idea']) && drupal_get_query_parameters()['idea'] == $value['key'] ? 'selected' : '' ?>><?= $value['value'] ?></option>
                    <?php } ?>
                  </select>
                </div>
              <?php } ?>
            </div>
          </form>
        </div>
        <div class="mod mod-media-lightbox">
          <?php if (!empty($data)) {
            foreach ($data as $k => $item) {
              ?>
              <article class="mod mod-case clearfix">

                <div class="content rich">
                  <h3><?= $item['title'] ?></h3>
                </div>

                <div class="image">
                  <?php if (!empty($item['video'])) { ?>
                  <a href="<?= $item['video'] ?>" class="js-media-lightbox cboxElement"
                     data-media-lightbox-type="video" data-media-lightbox-width="960" data-media-lightbox-height="540" target="_blank">
                    <div class="b-thumb-play"></div>
                    <?php
                    }
                    else { ?>
                    <a
                      href="<?= $item['image'] ?>"
                      class="js-media-lightbox" data-media-lightbox-type="image">
                      <?php } ?>
                      <picture class="mood-image">
                        <img src="<?= $item['image'] ?>">
                      </picture>
                    </a>
                </div>

                <div class="content rich">
                  <?= $item['content'] ?>
                  <?php if (!empty($item['document'])) { ?>
                    <p>
                      <i class="filetype-icon-pdf"></i>
                      <a class="b ga-pdf-download"
                         href="<?= user_is_logged_in() ? $item['document'] : url('user/login', array('query' => array('destination' => request_path()))) ?>"
                        <?= user_is_logged_in() ? 'target="_blank"' : '' ?>>
                        查看详情
                      </a>
                      (<?= get_file_extension($item['document']) ?>, <?= get_file_size($item['documentSize']) ?> MB)
                    </p>
                    <?php
                  } ?>
                </div>
              </article>
              <?php
            }
          } ?>

        </div>
      </div>
    </div>
  </div>
</div>
<script>
  (function ($) {
    $('.js-select').change(function () {
      var url = '?';
      var brand = $('.bid-<?= $url ?>').val();
      var disease = $('.did-<?= $url ?>').val();
      var idea = $('.iid-<?= $url ?>').val();
      if (brand != null && brand != undefined && brand != 0 && brand != '') {
        url += 'brand=' + brand + '&';
      }
      if (disease != null && disease != undefined && disease != 0 && disease != '') {
        url += 'disease=' + disease + '&';
      }
      if (idea != null && idea != undefined && idea != 0 && idea != '') {
        url += 'idea=' + idea + '&';
      }
      window.location.href = url;
    })
  })(jQuery);
</script>